// 封装请求函数

import config from './config.js'


const requset = (url,data={},method='get')=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:config.host + url,
			data,
			method,
			success:(response)=>{
				resolve(response.data)
			},
			fail: (err) => {
				console.log(err)
				reject(err)
			}
		})
	})
}

export default requset